import * as types from './mutation-types'
// import http from '../http'
// import Router from '../router'

const state = {
  bookItem: {}
}

const mutations = {
  [types.ORDER_CONFIRM](state, bookItem) {
    state.bookItem = bookItem
  },
  [types.ORDER_CREATED](state, bookItem) {
    delete state.bookItem
  }
}

const actions = {
  [types.ORDER_CONFIRM](context, payload) {
    context.commit(types.ORDER_CONFIRM, payload)
  },
  [types.ORDER_CREATED](context) {
    context.commit(types.ORDER_CREATED)
  }
}

export default {
  state,
  mutations,
  actions
}
